var e = (0, require("../../../../@babel/runtime/helpers/interopRequireDefault").default)(require("../../../../lib/dayjs/index")),
t = require("../core");
Component((0, t.formItem)()({
  properties: {
    placeholder: {
      type: String,
      value: "请选择"
    },
    type: {
      type: String,
      value: ""
    },
    title: {
      type: String,
      value: ""
    }
  },
  data: {
    valueText: null,
    pickerTime: null,
    visible: !1
  },
  observers: {
    value: function (t) {
      if (t) {
        var i = "year-month" == this.data.type ? "YYYY年MM月" : "YYYY年MM月DD日";
        this.setData({
          pickerTime: (0, e.default)(t).valueOf(),
          valueText: (0, e.default)(t).format(i)
        })
      }
    }
  },
  lifetimes: {
    attached: function () {
      this.data.value || this.setData({
        pickerTime: (0, e.default)().valueOf()
      })
    }
  },
  pageLifetimes: {},
  methods: {
    onTap: function () {
      console.log('klkl')
      this.setData({
        visible: !0
      })
    },
    onCancel: function () {
      this.setData({
        visible: !1
      })
    },
    onConfirm: function (t) {
      var i = (0, e.default)(t.detail).format("YYYY-MM-DD");
      this.setData({
        pickerTime: t.detail,
        visible: !1,
        value: i
      }), this.onChange(i)
    },
    onClose: function () {
      this.onChange(""), this.setData({
        pickerTime: (0, e.default)().valueOf()
      })
    }
  }
}));